package com.example.aigc_education.service.converter;

import com.example.aigc_education.domain.Note;
import com.example.aigc_education.domain.NoteTag;
import com.example.aigc_education.domain.dto.NoteDTO;
import com.example.aigc_education.domain.vo.NoteTagVO;
import com.example.aigc_education.domain.vo.NoteVO;
import org.mapstruct.*;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Mapper(componentModel = "spring")
public interface NoteConverter {

    /**
     * NoteList --> NoteVOList
     */
    @Mappings(
            @Mapping(target = "tags", ignore = true)
    )
    List<NoteVO> noteListToNoteVOList(List<Note> noteList);

    /**
     * noteDTO --> Note
     */
    @Mappings(
            value = {
                    @Mapping(source = "noteId", target = "noteId")
            }
    )
    Note noteDTOToNote(NoteDTO noteDTO);
}
